home *** CD-ROM | disk | FTP | other *** search
/ Video Toaster 4.2 / Video Toaster v4.2.iso / arexx / modeler / metricscale.lwm < prev    next >
Text File  |  1993-12-13  |  805b  |  35 lines

  1. /* CMD: Object to Metric
  2.  * Scale object created with numbers in wrong units to metric units
  3.  * By Arnie Cachelin © 1993 NewTek, Inc.
  4.  */
  5.  
  6. call addlib "LWModelerARexx.port", 0
  7. signal on error
  8. signal on syntax
  9. sysnam = 'Object to Metric'
  10.  
  11. Units='Naut.Mile Mile Yard Foot Inch'
  12. conv.5=.0254  /* meters/inch */
  13. conv.4=12*conv.5
  14. conv.3=3*conv.4
  15. conv.2=5280*conv.4
  16. conv.1=6076*conv.4
  17.  
  18. call req_begin sysnam
  19. id_tx  = req_addcontrol("Scale ","T","1 Meter so it's 1 unit")
  20. id_un  = req_addcontrol("Unit:","CV",Units)
  21. if (~req_post()) then do
  22.     call req_end()
  23.     exit
  24. end
  25. un =abs( req_getval(id_un))
  26. call req_end()
  27. if notify(2,'!Scale object by 'conv.un'?',"( Center at 0,0,0 )") then
  28.   call SCALE(conv.un)
  29. exit
  30.  
  31. syntax:
  32. error:
  33.   call end_all
  34.     t=Notify(1,'!Rexx Script Error','@'ErrorText(rc),'Line 'SIGL)
  35.     exit